<?php
/** .-------------------------------------------------------------------
 * |  Software: [HDPHP framework]
 * |      Site: www.hdphp.com  www.hdcms.com
 * |-------------------------------------------------------------------
 * |    Author: 向军 <2300071698@qq.com>
 * |    WeChat: aihoudun
 * | Copyright (c) 2012-2019, www.houdunwang.com. All Rights Reserved.
 * '-------------------------------------------------------------------*/

namespace app\admin\controller;

use system\model\Admin;

/**
 * 后台首页管理控制器
 * Class Entry
 * @package app\admin\controller
 */
class Entry extends Common
{
	//通过中间件实现局部可控制性
	public function __construct()
	{
		$this->auth();
	}

	public function index()
    {
        //加载模板文件
		return View::make();
    }

    //修改密码
	public function changePassword(Admin $admin)
	{
		if(IS_POST)
		{
			//返回一个数组，valid + message
			return $admin->changePassword(Request::post());
		}
		return view();
	}
}